\(\int \frac {1}{a+c x+b x^2} \, dx\) [88]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [F(-2)]
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 12, antiderivative size = 38 \[ \int \frac {1}{a+c x+b x^2} \, dx=\frac {2 \arctan \left (\frac {c+2 b x}{\sqrt {4 a b-c^2}}\right )}{\sqrt {4 a b-c^2}} \]

[Out]

2*arctan((2*b*x+c)/(4*a*b-c^2)^(1/2))/(4*a*b-c^2)^(1/2)

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {632, 210} \[ \int \frac {1}{a+c x+b x^2} \, dx=\frac {2 \arctan \left (\frac {2 b x+c}{\sqrt {4 a b-c^2}}\right )}{\sqrt {4 a b-c^2}} \]

[In]

Int[(a + c*x + b*x^2)^(-1),x]

[Out]

(2*ArcTan[(c + 2*b*x)/Sqrt[4*a*b - c^2]])/Sqrt[4*a*b - c^2]

Rule 210

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[-b, 2])^(-1))*ArcTan[Rt[-b, 2]*(x/Rt[-a, 2])
], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rule 632

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rubi steps \begin{align*} \text {integral}& = -\left (2 \text {Subst}\left (\int \frac {1}{-4 a b+c^2-x^2} \, dx,x,c+2 b x\right )\right ) \\ & = \frac {2 \tan ^{-1}\left (\frac {c+2 b x}{\sqrt {4 a b-c^2}}\right )}{\sqrt {4 a b-c^2}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.00 \[ \int \frac {1}{a+c x+b x^2} \, dx=\frac {2 \arctan \left (\frac {c+2 b x}{\sqrt {4 a b-c^2}}\right )}{\sqrt {4 a b-c^2}} \]

[In]

Integrate[(a + c*x + b*x^2)^(-1),x]

[Out]

(2*ArcTan[(c + 2*b*x)/Sqrt[4*a*b - c^2]])/Sqrt[4*a*b - c^2]

Maple [A] (verified)

Time = 2.12 (sec) , antiderivative size = 35, normalized size of antiderivative = 0.92

method result size
default \(\frac {2 \arctan \left (\frac {2 b x +c}{\sqrt {4 a b -c^{2}}}\right )}{\sqrt {4 a b -c^{2}}}\) \(35\)
risch \(-\frac {\ln \left (2 b x +\sqrt {-4 a b +c^{2}}+c \right )}{\sqrt {-4 a b +c^{2}}}+\frac {\ln \left (-2 b x +\sqrt {-4 a b +c^{2}}-c \right )}{\sqrt {-4 a b +c^{2}}}\) \(61\)

[In]

int(1/(b*x^2+c*x+a),x,method=_RETURNVERBOSE)

[Out]

2*arctan((2*b*x+c)/(4*a*b-c^2)^(1/2))/(4*a*b-c^2)^(1/2)

Fricas [A] (verification not implemented)

none

Time = 0.42 (sec) , antiderivative size = 113, normalized size of antiderivative = 2.97 \[ \int \frac {1}{a+c x+b x^2} \, dx=\left [-\frac {\sqrt {-4 \, a b + c^{2}} \log \left (\frac {2 \, b^{2} x^{2} + 2 \, b c x - 2 \, a b + c^{2} - \sqrt {-4 \, a b + c^{2}} {\left (2 \, b x + c\right )}}{b x^{2} + c x + a}\right )}{4 \, a b - c^{2}}, -\frac {2 \, \arctan \left (-\frac {2 \, b x + c}{\sqrt {4 \, a b - c^{2}}}\right )}{\sqrt {4 \, a b - c^{2}}}\right ] \]

[In]

integrate(1/(b*x^2+c*x+a),x, algorithm="fricas")

[Out]

[-sqrt(-4*a*b + c^2)*log((2*b^2*x^2 + 2*b*c*x - 2*a*b + c^2 - sqrt(-4*a*b + c^2)*(2*b*x + c))/(b*x^2 + c*x + a
))/(4*a*b - c^2), -2*arctan(-(2*b*x + c)/sqrt(4*a*b - c^2))/sqrt(4*a*b - c^2)]

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 124 vs. \(2 (32) = 64\).

Time = 0.10 (sec) , antiderivative size = 124, normalized size of antiderivative = 3.26 \[ \int \frac {1}{a+c x+b x^2} \, dx=- \sqrt {- \frac {1}{4 a b - c^{2}}} \log {\left (x + \frac {- 4 a b \sqrt {- \frac {1}{4 a b - c^{2}}} + c^{2} \sqrt {- \frac {1}{4 a b - c^{2}}} + c}{2 b} \right )} + \sqrt {- \frac {1}{4 a b - c^{2}}} \log {\left (x + \frac {4 a b \sqrt {- \frac {1}{4 a b - c^{2}}} - c^{2} \sqrt {- \frac {1}{4 a b - c^{2}}} + c}{2 b} \right )} \]

[In]

integrate(1/(b*x**2+c*x+a),x)

[Out]

-sqrt(-1/(4*a*b - c**2))*log(x + (-4*a*b*sqrt(-1/(4*a*b - c**2)) + c**2*sqrt(-1/(4*a*b - c**2)) + c)/(2*b)) +
sqrt(-1/(4*a*b - c**2))*log(x + (4*a*b*sqrt(-1/(4*a*b - c**2)) - c**2*sqrt(-1/(4*a*b - c**2)) + c)/(2*b))

Maxima [F(-2)]

Exception generated. \[ \int \frac {1}{a+c x+b x^2} \, dx=\text {Exception raised: ValueError} \]

[In]

integrate(1/(b*x^2+c*x+a),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(c^2-4*a*b>0)', see `assume?` f
or more deta

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 34, normalized size of antiderivative = 0.89 \[ \int \frac {1}{a+c x+b x^2} \, dx=\frac {2 \, \arctan \left (\frac {2 \, b x + c}{\sqrt {4 \, a b - c^{2}}}\right )}{\sqrt {4 \, a b - c^{2}}} \]

[In]

integrate(1/(b*x^2+c*x+a),x, algorithm="giac")

[Out]

2*arctan((2*b*x + c)/sqrt(4*a*b - c^2))/sqrt(4*a*b - c^2)

Mupad [B] (verification not implemented)

Time = 8.99 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.21 \[ \int \frac {1}{a+c x+b x^2} \, dx=\frac {2\,\mathrm {atan}\left (\frac {c}{\sqrt {4\,a\,b-c^2}}+\frac {2\,b\,x}{\sqrt {4\,a\,b-c^2}}\right )}{\sqrt {4\,a\,b-c^2}} \]

[In]

int(1/(a + c*x + b*x^2),x)

[Out]

(2*atan(c/(4*a*b - c^2)^(1/2) + (2*b*x)/(4*a*b - c^2)^(1/2)))/(4*a*b - c^2)^(1/2)